import com.alibaba.druid.pool.DruidDataSourceFactory;
import utils.JDBCUtils;

import javax.sql.DataSource;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;

/*
 *@Student 张策
 */
public class Main {
    public static void main(String[] args)  {
        PreparedStatement pre=null;
        Connection connection=null;
        try {
            connection = JDBCUtils.getConnection();
            String sql="INSERT INTO acc values(NULL,?,?)";
            pre=connection.prepareStatement(sql);
            pre.setString(1,"喜羊羊");
            pre.setDouble(2,11);
            int i = pre.executeUpdate();
            System.out.println(i);
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            JDBCUtils.close(pre,connection);
        }
    }
}